﻿using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Job
{
    /// <summary>
    /// 发送心跳
    /// </summary>
    public class OpticalJob : IJob
    {
        public async Task Execute(IJobExecutionContext context)
        {
            CancellationToken ct = CancellationToken.None;

             await Task.Run(async () => {
                JobDataMap data = context.JobDetail.JobDataMap;
                var scanProcess = data["sendHeart"] as Func<Task>;
                await scanProcess();
            }, ct);
        }
    }
}
